<?php
	function get_post_action( $name ){
	    $params = func_get_args();
	    
	    foreach( $params as $name ){
	        if( isset( $_POST[ $name ] ) ){
	            return $name;
	        }
	    }
	}

	switch( get_post_action( 'pesquisar', 'novo' ) ){
		case 'pesquisar':
			header('Location: pesquisar_orgao.php?nomeOrgao=' . $_REQUEST[ 'nomeOrgao' ] );
			break;
	
		case 'novo':
			header('Location: novo_orgao.php');
			break;
	
		default:
	}
?>